function [Xparts_dynamic] = make_Xdynamic_acctCreation(config, Xdynamic_staticInputs, installedBases, outputLabels)
	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	% No description available for function make_Xdynamic_acctCreation.
	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	%%%%% Inputs:
	% config:					object (from getConfig_acctCreation)
	% Xdynamic_staticInputs:	object
	% 	.Xparts_static:				cell(NumParts,1)
	%		{1}:						object
	%			.X							dim1 x NumXstatic
	%			.X_FEs						dim1 x NumX_FEs
	%   	    .NumX_FE_vals               1 x NumX_FEs
	%			.Xnames						cell(1,NumXstatic) of strings
	%			.X_FE_labels				cell(1, NumX_FEs) of strings
	% installedBases:			object
	% 	.laggedProviders:				dim1 x 1
	% 	.laggedConsumersOrig:			dim1 x 1
	% 	.laggedConsumersDest:			dim1 x 1
	% outputLabels:				boolean
	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	%%%%% Outputs:
	% Xparts_dynamic:			cell(NumParts,1)
	%	{1}:						object
	%		.X:							dim1 x NumXdynamic
	%		.X_FEs						dim1 x NumX_FEs
	%       .NumX_FE_vals               1 x NumX_FEs
	%		.Xnames:					cell(1,NumXdynamic) of strings
	%		.X_FE_labels				cell(1, NumX_FEs) of strings
	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	
	% Unbundle installedBases
	laggedConsumers = installedBases.laggedConsumers;
	laggedProviders  = installedBases.laggedProviders;
	
	% Unbundle Xdynamic_staticInputs
	Xparts_static = Xdynamic_staticInputs.Xparts_static;
	
	% Initialize Xparts_dynamic
	Xparts_dynamic = cell(1,1);
	
	if config.laggedBaseTransf.code == 4
		extraArgs     = Xdynamic_staticInputs.extraArgs;
		logDenom = extraArgs{4}; % K x 1
		K = size(logDenom,1);
		T = size(laggedConsumers(:),1)/K;
		
		laggedConsumers = reshape(laggedConsumers, [T K]); % T x K
		laggedProviders = reshape(laggedProviders, [T K]); % T x K
		
		logLaggedConsumers_density = log(1+laggedConsumers) - logDenom'; % T x K
		logLaggedProviders_density  = log(1+laggedProviders) - logDenom'; % T x K
		
		dim1 = size(logLaggedConsumers_density,1);
		newX = zeros(dim1,0);
		newXnames = {};
		for jj = 1:2
			if jj == 1
				laggedBase = logLaggedConsumers_density;
				laggedBaseName = 'logLaggedConsumers_density';
			else if jj == 2
				laggedBase = logLaggedProviders_density;
				laggedBaseName = 'logLaggedProviders_density';
			else
				error('This should not happen.')
			end; end;
			for widx = 1:length(Xdynamic_staticInputs.extraArgs{3}{jj})
				ww = Xdynamic_staticInputs.extraArgs{3}{jj}(widx);
				W = Xdynamic_staticInputs.extraArgs{1}{ww};
				Wname = Xdynamic_staticInputs.extraArgs{2}{ww};
				myX = reshape(laggedBase*W', [T*K,1]); % (T*K) x 1
				myXname = sprintf('%s_TIMES_%s', Wname, laggedBaseName);
				newX      = [newX myX];
				newXnames = [newXnames {myXname}];
			end
		end
	end

	Xparts_dynamic{1}.X            = [newX Xparts_static{1}.X];       % (T*K) x NumXdynamic
	Xparts_dynamic{1}.X_FEs        = Xparts_static{1}.X_FEs;
	Xparts_dynamic{1}.NumX_FE_vals = Xparts_static{1}.NumX_FE_vals;
	if outputLabels
		Xparts_dynamic{1}.Xnames      = [newXnames Xparts_static{1}.Xnames]; % 1 x NumX
		Xparts_dynamic{1}.X_FE_labels = Xparts_static{1}.X_FE_labels;
	end

end
